package cn.addr.user.model;

import java.io.Serializable;
import java.util.Date;

@SuppressWarnings("serial")
public class LinkPerson implements Serializable{
	private		 Long 		id;				
	private 	 String 	name;
	private 	 String 	telephone;
	private 	 String 	email;
	private 	 String 	homepage;
	private 	 Date 		birthday;
	private   	 String 	photourl;
	private 	 String 	jobunit;
	private   	 String 	address;
	private 	 String 	zipcode;
	private 	 Tag		tag;
	private 	 String 	remark;
	private 	 UserBean   user;

	/**
	 *  id           :long         			 , 可选, 联系人id.
        name         :string(30)   			 , 可选, 联系人名字.
        telephone    :string(15)  		 	 , 可选, 电话号码     。 
        email        :string(24)    		 , 可选, 电子邮箱    .
        homepage     :string(100)   		 , 可选, 个人主页    .
        birthday     :unix-time-millis    	 , 可选, 出生日期    , 创建时缺省为false.
        photourl     :string(100)       	 , 可选, 头像地址    , 创建时缺省为false.
        jobunit    	 :string(100)  		 	 , 可选, 工作单位    .
        address      :string(100)   		 , 可选, 地址	  .
        zipcode      :string(10 )   		 , 可选, 邮政编号     , 缺省不变更.
        taglist      :collection   			 , 可选, 标签/分组, 缺省不变更, 创建时缺省为 当前时间.
     *  remark		 :string(100)			 , 可选, 备注信息
     *  user		 :UserBean				 , 可选, 所属用户
	 */
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
	public Tag getTag() {
		return tag;
	}
	public void setTag(Tag tag) {
		this.tag = tag;
	}
	public String getTelephone() {
		return telephone;
	}
	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getHomepage() {
		return homepage;
	}
	public void setHomepage(String homepage) {
		this.homepage = homepage;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getPhotourl() {
		return photourl;
	}
	public void setPhotourl(String photourl) {
		this.photourl = photourl;
	}
	public String getJobunit() {
		return jobunit;
	}
	public void setJobunit(String jobunit) {
		this.jobunit = jobunit;
	}
	public String getZipcode() {
		return zipcode;
	}
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public UserBean getUser() {
		return user;
	}
	public void setUser(UserBean user) {
		this.user = user;
	}
	
	
	@Override
	public String toString() {
		return "LinkPerson [id=" + id + ", name=" + name + ", telephone="
				+ telephone + ", email=" + email + ", homepage=" + homepage
				+ ", birthday=" + birthday + ", photourl=" + photourl
				+ ", jobunit=" + jobunit + ", address=" + address
				+ ", zipcode=" + zipcode + ", tag="  + ", remark="
				+ remark + ", user=" + user + "]";
	}
	public LinkPerson() {
		super();
	}
	public LinkPerson(String name, String telephone, String email,
			String homepage, Date birthday, String photourl, String jobunit,
			String address, String zipcode, String remark) {
		super();
		this.name = name;
		this.telephone = telephone;
		this.email = email;
		this.homepage = homepage;
		this.birthday = birthday;
		this.photourl = photourl;
		this.jobunit = jobunit;
		this.address = address;
		this.zipcode = zipcode;
		this.remark = remark;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result
				+ ((homepage == null) ? 0 : homepage.hashCode());
		result = prime * result + ((jobunit == null) ? 0 : jobunit.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((remark == null) ? 0 : remark.hashCode());
		result = prime * result
				+ ((telephone == null) ? 0 : telephone.hashCode());
		result = prime * result + ((user == null) ? 0 : user.hashCode());
		result = prime * result + ((zipcode == null) ? 0 : zipcode.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		LinkPerson other = (LinkPerson) obj;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (homepage == null) {
			if (other.homepage != null)
				return false;
		} else if (!homepage.equals(other.homepage))
			return false;
		if (jobunit == null) {
			if (other.jobunit != null)
				return false;
		} else if (!jobunit.equals(other.jobunit))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (remark == null) {
			if (other.remark != null)
				return false;
		} else if (!remark.equals(other.remark))
			return false;
		if (telephone == null) {
			if (other.telephone != null)
				return false;
		} else if (!telephone.equals(other.telephone))
			return false;
		if (user == null) {
			if (other.user != null)
				return false;
		} else if (!user.equals(other.user))
			return false;
		if (zipcode == null) {
			if (other.zipcode != null)
				return false;
		} else if (!zipcode.equals(other.zipcode))
			return false;
		return true;
	}
	
	
	
	
	
}
